package com.jy.controller;


import com.jy.common.enums.ResponseWrapper;
import com.jy.common.model.user.param.HandupOrHandDownParam;
import com.jy.common.tool.CommonTool;
import com.jy.service.ThumbsUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 点赞表（用户点赞，点赞类型：帖子，动态，笔记......） 前端控制器
 * </p>
 *
 * @author fzg
 * @since 2024-11-14
 */
@RestController
@RequestMapping("/thumbs-up")
public class ThumbsUpController {

    private final ThumbsUpService thumbsUpService;

    public ThumbsUpController(ThumbsUpService thumbsUpService) {
        this.thumbsUpService = thumbsUpService;
    }

    @GetMapping("/handUpOrHandDown")
    public ResponseWrapper handUpOrHandDown(HttpServletRequest request, @Validated HandupOrHandDownParam param) {
        System.out.println(param);
        return thumbsUpService.handUpOrHandDown(CommonTool.getUserAidByToken(request),param);
    }

}
